package com.xingda.packing.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@Slf4j
public class PackLineService {

    @Value("${com.xingda.model}")
    private String model;

    @Autowired
    private com.xingda.packing.dmds.service.PackLineService dmdsPackLineService;
    @Autowired
    private com.xingda.packing.dmss.service.PackLineService dmssPackLineService;

    @PostConstruct
    public void start() {
        log.info("==== model:{}", model);
        if (model.equals("DMSS")) {
            dmssPackLineService.start();
        } else if (model.equals("DMDS")) {
            dmdsPackLineService.start();
        } else {
            log.error("==== PackLineService的model异常");
        }
    }
}
